home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libg++ / old-stream / filebuf.h < prev    next >
C/C++ Source or Header  |  1992-01-04  |  2KB  |  62 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. /* 
  3. Copyright (C) 1988 Free Software Foundation
  4.     written by Doug Lea (dl@rocky.oswego.edu)
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY.  No author or distributor
  10. accepts responsibility to anyone for the consequences of using it
  11. or for whether it serves any particular purpose or works at all,
  12. unless he says so in writing.  Refer to the GNU CC General Public
  13. License for full details.
  14.  
  15. Everyone is granted permission to copy, modify and redistribute
  16. GNU CC, but only under the conditions described in the
  17. GNU CC General Public License.   A copy of this license is
  18. supposed to have been given to you along with GNU CC so you
  19. can know your rights and responsibilities.  It should be in a
  20. file named COPYING.  Among other things, the copyright notice
  21. and this notice must be preserved on all copies.  
  22. */
  23.  
  24. #ifndef _filebuf_h
  25. #ifdef __GNUG__
  26. #if (__GNUG__ == 1)
  27. #pragma once
  28. #endif
  29. #pragma interface
  30. #endif
  31. #define _filebuf_h 1
  32.  
  33. #include <streambuf.h>
  34. #include <stdio.h>
  35.  
  36. class filebuf: public streambuf
  37. {
  38. public:
  39.   int         fd;
  40.   char        opened;
  41.  
  42.   int         overflow(int c = EOF);
  43.   int         underflow();
  44.  
  45.               filebuf();
  46.               filebuf(int newfd);
  47.               filebuf(int newfd, char* buf, int buflen);
  48.  
  49.              ~filebuf();
  50.  
  51.   streambuf*  open(const char* name, open_mode m);
  52.   streambuf*  open(const char* filename, io_mode m, access_mode a);
  53.   streambuf*  open(const char* filename, const char* m);
  54.   streambuf*  open(int  filedesc, io_mode m);
  55.   streambuf*  open(FILE* fileptr);
  56.   int         is_open();
  57.   int         close();
  58. };
  59.  
  60.  
  61. #endif
  62.